grammar vecMath;

prog : stat+;

stat : ID '='  expr 
    | 'print ' expr 
    ;
expr : multExpr (ADD multExpr)*;

multExpr : primary (MULT primary)*;

primary : INT
    | ID 
    | '[' expr (',' expr)* ']' 
    ;

MULT : '*' | '.';
ADD : '+';
COMMA:',';

ID : [a-z]+;
INT : [0-9]+;
WS : (' '|'\r'|'\n') -> skip;